Conversation
Contributor
hellovai
commented
Jul 22, 2024
- Adding some hooks to allow testing BFCL
- update builder
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
PR Summary
The pull request introduces serialization capabilities and new methods for enhanced testing and debugging across various components.
- engine/baml-lib/jinja/src/lib.rs: Added
Serializetrait toRenderedPromptandRenderContext_Client, updatedrender_promptfunction for type safety, and included new unit tests. - engine/baml-runtime/src/internal/llm_client/mod.rs: Added
Serializetrait to multiple structs and enums for better data handling. - engine/language_client_codegen/src/python/templates/async_client.py.j2: Introduced
z_unstable_runtimeandz_unstable_ctx_managermethods inBamlAsyncClientfor internal access. - engine/language_client_python/src/types/function_results.rs: Added
internalsmethod toFunctionResultfor JSON serialization of internal LLM responses. - engine/language_client_python/src/types/type_builder.rs: Enhanced type-building capabilities with new methods and imports from
pyo3.
8 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
There was a problem hiding this comment.
PR Summary
(updates since last review)
The pull request introduces a macro for reducing redundancy in Python client struct implementations and adds an unstable async client template.
- engine/language-client-codegen/src/python/mod.rs: Introduced a macro to streamline
FromandTryFromtrait implementations for Python clients. - engine/language-client-codegen/src/python/templates/unstable_async_client.py.j2: Added
UnstableBamlAsyncClientclass for handling asynchronous BAML operations. - engine/language-client_python/python_src/baml_py/baml_py.pyi: Removed
Listimport from thetypingmodule; ensure no dependencies are affected.
3 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings
Comment on lines
+70
to
+73
| if raw.is_ok() is None: | ||
| mdl = create_model("{{ fn.name }}ReturnType", inner=({{ fn.return_type }}, ...)) | ||
| return raw, (True, coerce(mdl, raw.parsed())) | ||
| return raw, (False, None) |
There was a problem hiding this comment.
Logic: The condition if raw.is_ok() is None seems incorrect. It should likely be if raw.is_ok() to check if the result is successful.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.